package com.coocaa.ops.admin.v1.device.biz;

import com.coocaa.ops.admin.v1.device.mapper.IGlobalDeviceInfoMapper;
import com.coocaa.ops.common.core.base.BaseBizImpl;
import com.coocaa.ops.common.core.base.mybatis.QueryTemplate;
import com.coocaa.ops.common.core.biz.device.entity.GlobalDeviceInfoEntity;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tangminghong
 * @date 2019.5.18
 */
@Service
public class GlobalDeviceInfoBizImpl extends BaseBizImpl<IGlobalDeviceInfoMapper, GlobalDeviceInfoEntity> implements IGlobalDeviceInfoBiz {

    /**
     * 根据机芯、机型及平台查询
     *
     * @param chip
     * @param model
     * @param platform
     * @return
     */
    @Override
    public List<GlobalDeviceInfoEntity> getByChipModelAndPlatform(String chip, String model, String platform) {
        QueryTemplate<GlobalDeviceInfoEntity> wrapper = new QueryTemplate<>();
        wrapper.eq("chip", chip);
        wrapper.eq("model", model);
        wrapper.eq("platform", platform);
        return getMapper().selectList(wrapper);
    }
}
